﻿@model ParticipacionVecinalWeb.Models.ParticipacionVecinal.IV
@{
    

    ViewBag.Title = "Registrar Requerimiento";
    Layout = "~/Views/Shared/_LayoutMaster.cshtml"; 
     
}
@section ScriptsSection {
    <script src="~/Scripts/ParticipacionVecinal/RegistrarIniciativa.js"></script>
}

<div class="form-inline" id="idContenedor">
    <input type="hidden" id="hidId" value="@(Model.ID)" />
    <input type="hidden" id="hidIni" value="0" />

    <h1 class="page-header">Registrar Requerimiento</h1>
    <hr />

    <div class="row show-grid" style="margin-top: 10px;">
        <div class="col-md-10">
            <div class="col-xs-6 col-sm-3">
                <label>Nro Requerimiento:</label>
            </div>
            <div class="col-xs-6 col-sm-3">
                <input id="txtNroRequerimiento" value="@(Model.C)" class="form-control" style="width: 100%" disabled />
            </div>
        </div>
        <div class="col-md-10">
            <div class="col-xs-6 col-sm-3">
                <label>Fecha de Registro:</label>
            </div>
            <div class="col-xs-6 col-sm-3">
                <input id="txtFeRegistro" value="@Model.FE" class="form-control" style="width: 100%" disabled />
            </div>
        </div>
    </div>


    <div class="row show-grid" style="margin-top: 10px;">
        <div class="col-md-10">
            <div class="col-xs-6 col-sm-3">
                <label>Sectorista:</label>
            </div>
        </div>
        <div class="col-md-10">
            <div class="col-xs-6 col-sm-3">
                <input id="txtNombreSectorista" value="@Model.S" class="form-control" style="width: 100%" disabled />
            </div>
        </div>
    </div>
    @*<div class="row" style="margin-top: 10px;">
        <div class="col-md-10">
            <div class="col-md-4 col-xs-3">
                <label>Responsable Requerimiento</label><br>
            </div>
            <div class="col-md-8 col-xs-9">
                <input id="txtRespRequerimiento"  value="@Model.R"  class="form-control" style="width: 100%" disabled />
            </div>
        </div>
    </div>*@
    @*    <div class="row" style="margin-top: 10px;">
        <div class="col-md-10">
            <div class="col-md-4 col-xs-3">
                <label>Área responsable</label><br>
            </div>
            <div class="col-md-8 col-xs-9">
                <select id="cboArea" class="form-control input-sm" onchange="fn_BuscarResponsable();">
                    <option value="0">Seleccione</option>
                </select>
            </div>
        </div>
    </div>*@
</div>

@*<div class="row" style="margin-top: 10px;">
    <div class="col-md-10">
        <div class="col-md-4 col-xs-3">
            <label>Jefe de Área responsable</label><br>
        </div>
        <div class="col-md-8 col-xs-9">
            <input type="hidden" id="hidJefe" value="0" />
            <input id="txtJefeAreaRes" class="form-control" style="width: 100%"  disabled />
        </div>
    </div>
</div>*@
<div class="row show-grid" style="margin-top: 10px;">
    <div class="col-md-10">
        <div class="col-md-4 col-xs-3">
            <label>Código de Iniciativa:</label>
        </div>

        @if (Model.ID > 0) {
            <div class="col-xs-6 col-sm-3">
                <input id="txtIniciativa" value="@Model.DE" class="form-control" style="width: 100%" disabled />
                <a href="#" onclick="fn_VerIniciativa()">[Ver Detalle]</a>
                <input type="hidden" id="hidIV" value="@Model.DE" />
            </div>
        } else {
            <div class="col-xs-6 col-sm-3" style="padding-right: 0;">
                <input id="txtIniciativa" value="@Model.DE" class="form-control" style="width: 100%" disabled />
            </div>
            <div class="col-xs-6 col-sm-3">
                <a href="#" onclick="fn_CargaBusquedaIniciativa(event);">
                    <span class="glyphicon glyphicon-search"></span>
                </a>
            </div>
        }

    </div>
</div>
<div class="row show-grid" style="margin-top: 10px;">
    <div class="col-md-10">
        <div class="col-xs-6 col-sm-3">
            <label>Observaciones del Requerimiento:</label>
        </div>
        <div class="col-xs-6 col-sm-3">
        </div>
    </div>
</div>

<div class="row show-grid" style="margin-top: 10px;">
    <div class="col-md-10">

        <div class="col-xs-6 col-sm-3">
            <textarea id="txtObservacion" cols="100" rows="5">@Model.DET</textarea>
        </div>
    </div>
</div>


@if (Model.ID <= 0) { 
    <div class='modal-footer'>
        <button type="button" class="btn btn-primary" id="btnFaltanteGuardar" onclick="fnGuardarIniciativa();">
            <span class="glyphicon glyphicon-saved"></span>&nbsp; &nbsp;Guardar
        </button>
        <button type="button" class="btn btn-primary" data-dismiss="modal" onclick="fnRetroceder()">
            <span class="glyphicon glyphicon-remove"></span>&nbsp; &nbsp;Cerrar
        </button>
    </div>
}else{
      <div class='modal-footer'>
        <button type="button" class="btn btn-primary" id="btnFaltanteGuardar" onclick="fnActualizarIniciativa();">
            <span class="glyphicon glyphicon-saved"></span>&nbsp; &nbsp;Actualizar
        </button>
        <button type="button" class="btn btn-primary" data-dismiss="modal" onclick="fnRetroceder()">
            <span class="glyphicon glyphicon-remove"></span>&nbsp; &nbsp;Cerrar
        </button>
    </div>
}



</div>


<div class="modal fade" id="ModalIniciativa" role="dialog" aria-labelledby="headerSSTSustento" aria-hidden="true" data-backdrop="static" data-keyboard="false" style="width: auto;">
    <div class="modal-dialog modal-lg">
        <div class="modal-content" style="max-width: 800px; width: 100%;">
            <div class="modal-header modal-header-primary">
                <h4 class="modal-title" id="titleSustento" style="color: #ffffff;">Busqueda de Iniciativa Vecinal</h4>
            </div>
            <div class="modal-body">
                <form class="contact" id="Form7">
                    <div id="divIniciativa" class="row show-grid" style="margin-top: 10px;">
                        <!--------------------------------------------------------------------------------->
                        <div id="divSustentoSD" style="height: auto!important;">
                            <div class="row show-grid" style="margin-top: 10px;">
                                <div class="col-md-10">
                                    <div class="col-xs-6 col-sm-3">
                                        <label>Fecha de Registro desde</label>
                                    </div>
                                    <div class="col-xs-6 col-sm-3">
                                        <input id="txtFeIni01" class="form-control" style="width: 100%" />
                                    </div>
                                </div>
                                <div class="col-md-10">
                                    <div class="col-xs-6 col-sm-3">
                                        <label>Hasta</label>
                                    </div>
                                    <div class="col-xs-6 col-sm-3">
                                        <input id="txtFeFin01" class="form-control" style="width: 100%" />
                                    </div>
                                </div>
                            </div>
                            <div class="row show-grid" style="margin-top: 10px;">
                                <div class="col-md-10">
                                    <div class="col-xs-6 col-sm-3">
                                        <label>Estado</label>
                                    </div>
                                    <div class="col-xs-6 col-sm-3">
                                        <select id="cboEstado01" class="form-control input-sm">
                                            <option value="0">Seleccione</option>
                                        </select>
                                    </div>
                                </div>
                                <div class="col-md-10">
                                    <div class="col-xs-6 col-sm-3">
                                    </div>
                                    <div class="col-xs-6 col-sm-3">
                                        <button type="button" class="btn btn-primary" onclick="fn_BuscarIniciativa();">
                                            <span class="glyphicon glyphicon-search"></span>&nbsp; &nbsp;Buscar
                                        </button>
                                    </div>
                                </div>
                            </div>
                            <div class="row show-grid" style="margin-top: 10px; margin-left: 1px; margin-right: 1px;">
                                <div id="gridIniciativa" style="margin-left: 12px; margin-right: 12px;"></div>
                            </div>
                            <!--------------------------------------------------------------------------------->
                        </div>
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-primary" data-dismiss="modal">
                    <span class="glyphicon glyphicon-remove"></span>&nbsp; &nbsp;Cerrar
                </button>
            </div>
        </div>
    </div>
</div>

